package com.dawnClass.service.impl;

import com.dawnClass.mapper.VideoMapper;
import com.dawnClass.pojo.Video;
import com.dawnClass.service.VideoService;
import com.dawnClass.util.ServiceResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class VideoServiceImpl implements VideoService {

    @Autowired
    private VideoMapper videoMapper;

    @Override
    public ServiceResponse getVideoByVideoId(Integer videoId) {
        Video video = videoMapper.selectByPrimaryKey(videoId);
        if (video != null)
            return ServiceResponse.getSuccess(video);
        return ServiceResponse.getFail(null);
    }
}
